package cn.wolfcode.web.controller;

import cn.wolfcode.domain.CustomerReport;
import cn.wolfcode.qo.CustomerReportQueryObject;
import cn.wolfcode.service.ICustomerReportService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class HistogramController {

    @Autowired
    private ICustomerReportService service;

    @RequestMapping("/show")
    public String show(Model model, @ModelAttribute("qo") CustomerReportQueryObject qo){
        qo.setPageSize(0);
        PageInfo<CustomerReport> pageInfo = service.getPageInfo(qo);
        model.addAttribute("list",pageInfo.getList());
        return "histogram/Histogram";
    }
}
